package com.ctl.szmd.szmd.feature_wm.ui.fragment.pager1

import android.os.Bundle
import android.view.View
import androidx.lifecycle.Observer
import androidx.lifecycle.lifecycleScope
import com.ctl.szmd.szmd.feature_wm.R
import com.ctl.szmd.szmd.feature_wm.databinding.FragmentWmBriefBinding
import com.ctl.szmd.szmd.feature_wm.ui.base.BaseWmBindingFragment
import com.ctl.szmd.szmd.feature_wm.ui.viewmodel.pager1.WmBriefViewModel
import kotlinx.android.synthetic.main.fragment_wm_brief.*
import org.koin.android.viewmodel.ext.android.viewModel


class WmBriefFragment : BaseWmBindingFragment<FragmentWmBriefBinding>() {

    private val viewModel: WmBriefViewModel by viewModel()

    override fun getLayoutId(): Int = R.layout.fragment_wm_brief

    override fun initView() {
        lifecycle.addObserver(viewModel)

        lifecycleScope.launchWhenCreated {
            viewModel.getFulianAppIndexIntro.observe(viewLifecycleOwner, Observer {
                web_view.loadData(it.fulianAppIndexIntro, "text/html; charset=UTF-8", null)
            })
        }
    }
}